package com.faxsun.core.service;

import java.util.Date;
import java.util.List;

import mtons.modules.pojos.Page;

import com.faxsun.core.persist.entity.LivePO;
import com.faxsun.core.persist.entity.WechatMsgPO;

public interface WechatService {

	public void save(WechatMsgPO po);

	public List<WechatMsgPO> listRecent(Page page, String topic);

	public void saveEvent(LivePO livepo);

	/**
	 * paging all existing live events
	 * 
	 * @param isAdminEnd 是否来自后端的请求
	 * @return list page of exsiting events
	 */
	public Page pagingAllEvent(Page page,boolean isAdminEnd);

	/**
	 * List recent live event regarding to current time, including both events
	 * whose startTime is 2months/60days ahead of current time and events whose
	 * startTime is 2months/60days after of current time
	 * 
	 * @param current
	 *            time as base
	 * @return list of recent events
	 */
	public void pagingRecentEvent(Page page, Date current);

	/**
	 * List finished live event regarding to current time, including events
	 * whose endTime is ahead of current time
	 * 
	 * @param current
	 *            time as base
	 * @return list of finished events
	 */
	public void pagingFinishedEvent(Page page, Date current);

	/**
	 * List active live event regarding to current time, including events where
	 * current time could fit in their range: [startTime,endTime]
	 * 
	 * @param current
	 *            time as base
	 * @return list of active events
	 */
	public void pagingActiveEvent(Page page, Date current);

	/**
	 * List live event regarding to given topic
	 * 
	 * @param topic
	 * @return live event with given topic or null
	 */
	public LivePO findEventByTopic(String topic);

	/**
	 * List live event regarding to given id
	 * 
	 * @param id
	 * @return live event with given id or null
	 */
	public LivePO findEventById(long id);

	public void pagingPresentChannels(Page page);

	public void pagingPastChannels(Page page);

	public void pagingFutureChannels(Page page);
	
	public int cntAllLive();
}
